#include "PlasmaCannon.hpp"
#include "PlasmaCannonStates.hpp"
#include <iostream>

using namespace std;

PlasmaCannon::PlasmaCannon(MVector3D& pos, int& iFireRate, float& fDamage, float& fBulletSpeed) : Weapon(iFireRate, fDamage, fBulletSpeed)
{
	m_shotPos = pos;
	float zero = 0.0f;
	m_offset.Set(zero, zero, zero);

	m_pMFSMachine = new MFSMachine<PlasmaCannon, PlasmaCannonStateName>(this);
	m_pMFSMachine->setCurrentState(new PlasmaCannonIdle());
	m_pMFSMachine->setListenerState(new PlasmaCannonListen());
}

PlasmaCannon::~PlasmaCannon()
{
	delete m_pMFSMachine; m_pMFSMachine = NULL;
}

void PlasmaCannon::update(clock_t tick)
{
	m_pMFSMachine->updateMFSM(tick);
}

MFSMachine<PlasmaCannon, PlasmaCannonStateName>* PlasmaCannon::getStateMachine()
{
	return m_pMFSMachine;
}

//EOF
